// 字典 
import { getDict } from "@/api/login"
import { mapMutations } from 'vuex'
// const dictList = [
//     "resume_label",
//     "requirements_years",//工作年限
//     "education",//学历
//     "company_type",//公司性质
//     "company_size",//公司规模
//     "company_industry",//所属行业
//     "position_nature",//职位性质
//     "welfare_treatment",//福利
//     "sys_yes_no",//是否
//     "sys_user_sex",//性别
//     "key_population_information",//重点人群
//     "marriage",//婚姻
//     "position_nature",//工作性质
//     "salary",//薪资
//     "arrival_time",//到岗时间
//     "status_of_job_hunting",//求职状态
//     "proficiency_level",//技能熟练度
//     "political_outlook",//政治面貌
//     "interview_type",//面试方式
//     "sms_type",//通知类别
//     "position_type",//招聘项目类型
//     "resume_matching_config",//简历匹配度配置
//     "system_first_config",//系统初筛配置
//     "resume_screening_process_config",//简历筛选流程配置
// ]
const that=this
export const dictFun = async () => {
    getDict().then(res => {
        console.log("全部字典数据", res);
        // console.log(this.$store.state.dictData);
        // this.$store.commit('updateMyArray', res.data);
        // console.log(this.$store.state.dictData);
        // that.$cookies.set('token', 1112222)
    //    console.log(that.$cookies.get("token")); 
        sessionStorage.setItem("dictData", JSON.stringify(res.data))
    })
}

export const dictSect = (res) => {
    const dictDatas = JSON.parse(sessionStorage.getItem("dictData")) || []
    let array = []
    dictDatas.forEach(element => {
        if (element.dictType == res) {
            array = element.dictDataList
        }
    });
    return array
}
export const dictFuns = (value, res) => {
    const dictDatas = JSON.parse(sessionStorage.getItem("dictData")) || []
    // console.log(value,dictDatas[res]);
    let string = ""
    dictDatas.forEach(element => {
        if (element.dictType == res) {
            element.dictDataList.forEach(element => {
                if (value == element.dictValue) {
                    string = element.dictLabel
                }
            })
        }
    });
    return string
}

